<template>
  <div class="exception-page">
    <div class="exception-container">
      <h1 class="exception-title">{{ data.title }}</h1>
      <p class="exception-desc">{{ data.desc }}</p>
      <el-button type="primary" @click="goHome">{{ data.btnText }}</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
import { useRouter } from 'vue-router'
import { routesAlias } from '../../router/modules/routerAlias'

// 定义组件的 props
const props = defineProps({
  data: {
    type: Object,
    required: true
  }
})

const router = useRouter()

// 返回首页的方法
const goHome = () => {
  router.push(routesAlias.Dashboard)
}
</script>

<style scoped>
.exception-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 500px;
}

.exception-container {
  text-align: center;
  padding: 20px;
}

.exception-title {
  font-size: 72px;
  color: #409EFF;
  margin-bottom: 10px;
}

.exception-desc {
  font-size: 20px;
  color: #606266;
  margin: 20px 0 30px;
}
</style> 